/*
 * SafeArrayTest.h
 *
 *  Created on: 2014. 4. 30.
 *      Author: zenoniaonline
 */

#ifndef SAFEARRAYTEST_H_
#define SAFEARRAYTEST_H_

#include <gtest/gtest.h>

#include "../NUtil/SafeArray.h"

namespace TDD {

class SafeArrayTest : public testing::Test
{
public:
	::ProjectZ::NUtil::SafeArray<int, 10> _clsSafeArray;

public:
	virtual void SetUp()
	{
		_clsSafeArray.Initialize(0);
	}

	virtual void TearDown()
	{
	}
};

TEST_F(SafeArrayTest, GetValueTest)
{
	int nRetValue = -1;
	ASSERT_TRUE(_clsSafeArray.GetValue(0, nRetValue));
	EXPECT_EQ(0, nRetValue);
}

TEST_F(SafeArrayTest, SetValueTest)
{
	int nRetValue = 10;
	ASSERT_TRUE(_clsSafeArray.SetValue(0, nRetValue));
}

TEST_F(SafeArrayTest, ExceptionGetValueTest)
{
	int nRetValue = -1;
	ASSERT_FALSE(_clsSafeArray.GetValue(15, nRetValue));
}

TEST_F(SafeArrayTest, ExceptionSetValueTest)
{
	int nRetValue = 15;
	ASSERT_FALSE(_clsSafeArray.SetValue(15, nRetValue));
}

} /* TDD */



#endif /* SAFEARRAYTEST_H_ */
